How to make a clones for the buttons? [closed]
Posted
by
user1764781
on Programmers
See other posts from Programmers
or by user1764781
Published on 2012-11-09T09:12:12Z
Indexed on
2012/11/09
11:20 UTC
Read the original article
Hit count: 216
I need to create the new button that allows to make the clone of buttons in the code below.
Please share some ideas, codes, links, scripts.
using UnityEngine;
using System.Collections;
public class hibye: MonoBehaviour
{
public string slectedItem = "fd";
private bool editing = false;
private void OnGUI()
{
if ( GUILayout.Button(slectedItem))
{
editing = true;
}
if (editing)
{
string[] sig = {"Banana","Apple","Orange"};
for (int x = 0; x < sig.Length ; x++)
{
if (GUILayout.Button(sig[x]))
{
slectedItem = sig[x];
editing = false;
}
}
}
}
}
© Programmers or respective owner